
str = "abcdefg"


str2 =str[2:4:1]
print(str2)


str3 =str[:4:1]
print(str3)


str4 =str[2::1]
print(str4)

str5=str[2:4:]
print(str5)


list = ["刘备","关羽","张飞","赵云","马超","黄盖"]
list2 =list[2:4:1]
print(list2)

list3 =list[::2]
print(list3)


list4 =list[::-1]
print(list4)